﻿using System.Data.Entity.ModelConfiguration;

namespace wh40klbModel.ModelConfiguration
{
    class SquadVehiculeInclusionConfiguration : EntityTypeConfiguration<SquadVehiculeInclusion>
    {
        public SquadVehiculeInclusionConfiguration()
        {
            //Cle Primaire et table
            HasKey(sti => new { sti.SquadId, sti.VehiculeId });
            //Propriete

            //cle etrangere
            HasRequired(sti => sti.Squad).WithMany(s => s.Vehicules);
            HasRequired(sti => sti.Vehicule).WithMany(v => v.Squads);
        }
    }
}
